package calendar.view;

import calendar.model.CalendarModel;
import calendar.view.forms.EventForm;
import calendar.view.panels.CalendarListStackPanel;
import calendar.view.panels.EventsStackPanel;
import com.google.api.services.calendar.model.Event;
import com.google.api.services.calendar.model.Events;
import swing.Dialog;
import swing.EntityPanel;
import swing.ModelPanel;

import javax.swing.*;

public class CalendarDialog extends Dialog {

    public CalendarDialog() {
        super(Flag.CENTERED, Flag.PACKED);

        getContentPane().add(new ModelPanel(CalendarModel.INSTANCE));

        JTabbedPane tabbedPane = new JTabbedPane();
        getContentPane().add(new ModelPanel(CalendarModel.INSTANCE));

        CalendarListStackPanel calendarListStackPanel = new CalendarListStackPanel();
        tabbedPane.add("Calendar list", calendarListStackPanel);

        tabbedPane.add("Events", new EntityPanel<Events, String, Event>(new EventForm(), new EventsStackPanel()));
    }

    public static void main(String... args) {
        new CalendarDialog().setVisible(true);
    }
}
